<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js基础语法</title>
	<script type="text/javascript">
		window.onload = function() {
			// body...
			var oDiv = document.getElementById('div1');
			oDiv.title = "我看到了!";

			var oA = document.getElementById('link1');
			oA.href = "http://www.baidu.com";
			oA.title = "工头";

			alert(oA.href)

		}
	</script>
</head>
<body>
	<div id="div1" class="div1" title="这是DIV元素,看你麻痹!">
		这是一个DIV元素
	</div>

	<a href="#" id="link1">百度网</a>

</body>
</html>